﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Client
{
    public partial class f_QLSP : Form
    {
        private string CurrentName="";
        public f_QLSP()
        {
            InitializeComponent();
        }

        private void exit(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void LoadView(object sender, EventArgs e)
        {
            this.panel_Main.Controls.Add(new QLSP_View());
            this.CurrentName = "button_QLSP";
        }

        private void ChooseTask(object sender, EventArgs e)
        {
            Button temp = (Button)sender;
            switch (temp.Name)
            {
                case "button_QLSP":
                    if (CurrentName.Equals("button_QLSP"))
                        return;
                    this.panel_Main.Controls.Clear();
                    this.panel_Main.Controls.Add(new QLSP_View());
                    CurrentName = "button_QLSP";
                    break;
                case "button_LSP":
                    if (CurrentName.Equals("button_LSP"))
                        return;
                    this.panel_Main.Controls.Clear();
                    this.panel_Main.Controls.Add(new LoaiSanPham_View());
                    CurrentName = "button_LSP";
                    break;
                case "button_Tim":
                    if(CurrentName.Equals("button_Tim"))
                        return;
                    this.panel_Main.Controls.Clear();
                    this.panel_Main.Controls.Add(new TimKiemSP_View());
                    CurrentName = "button_Tim";
                    break;
            }
        }
    }
}
